<?php
/**
 *
 * @author ninetyseven.
 * @date 2023-03-29 0:26
 */

namespace App\Enum;

class OrderEnum
{
    public const FAKE_USER_ID = [];
    /**
     * 待支付
     */
    public const PAY_STATUS_TODO = 1;
    /**
     * 支付成功
     */
    public const PAY_STATUS_SUCCESS = 2;
    /**
     * 支付失败
     */
    public const PAY_STATUS_FAILED = 3;
    /**
     * 线下结账
     */
    public const PAY_STATUS_OFFLINE = 4;
    /**
     * @int 订单待接单
     */
    public const STATUS_PENDING_ORDER = 1;

    /**
     * @int 订单待出行
     */
    public const STATUS_PENDING_TRAVEL = 2;

    /**
     * @int 订单行驶中
     */
    public const STATUS_DRIVING = 3;


    /**
     * @int 订单已完成
     */
    public const STATUS_SUCCESS = 4;

    /**
     * @int 订单已取消
     */
    public const STATUS_CANCEL = 5;


    /**
     * @int 订单已超时
     */
    public const STATUS_TIMEOUT = 6;
    /**
     * @int 司机开车去接客
     */
    public const STATUS_PICKUP_START = 7;
    /**
     * @int 司机开车接到乘客
     */
    public const STATUS_PICKUP_ARRIVED = 8;
    /**
     * @float 价格-每公里
     */
    public const PRICE_KM_NUM = 5.2;
    /**
     * 公里和金额的小数点位数
     */
    public const ORDER_DISTANCE_PRECISE_LENGTH=2;
    public const ORDER_AMOUNT_PRECISE_METHOD='floor';

    public const ORDER_RETURN_CODE = 2;

    /**
     * @int 服务订单
     */
    public const ORDER_TYPE_SERVICE = 1;

    /**
     * @int 指派订单
     */
    public const ORDER_TYPE_ASSIGN = 2;

    /**
     * @int 支付方式- 公益出行-积分
     */
    public const ORDER_PAY_GYCX_AXD = 3;
    public const ORDER_PAY_SQJSG = 4;
    public const ORDER_PAY_ENTERPRISE_COMMUTE_10W =5;
    /**
     * 商业订单，线下结账
     */
    public const ORDER_PAY_OFFLINE_PAYMENT =7;
    /**
     * 币种 - 善行币
     */
    public const ORDER_PAY_SXCX_COIN = 8;
    /**
     * @int 支付方式-积分
     */
    public const ORDER_PAY_INTEGRAL = 2;

    /**
     * @int 支付方式-数字人民币
     */
    public const ORDER_PAY_DIGITAL = 1;
    // 允许支付的类型
    public const ORDER_PAY_KEYS =[
        'commute_10w'  =>  self::ORDER_PAY_ENTERPRISE_COMMUTE_10W,
        'sqjsg'  =>  self::ORDER_PAY_SQJSG,
        'gycx_axd'  =>  self::ORDER_PAY_GYCX_AXD,
        'point'     =>  self::ORDER_PAY_INTEGRAL,
        'digital'   =>  self::ORDER_PAY_DIGITAL,
        'offline'   => self::ORDER_PAY_OFFLINE_PAYMENT
    ];

    public const AMOUNT_UNIT = [
        self::ORDER_PAY_DIGITAL     => '数字人民币',
        self::ORDER_PAY_INTEGRAL    => '公益诚信积分',
        self::ORDER_PAY_GYCX_AXD    => CardEnum::CARD_VALUE_UNIT[self::ORDER_PAY_GYCX_AXD],
        self::ORDER_PAY_SQJSG    => CardEnum::CARD_VALUE_UNIT[self::ORDER_PAY_SQJSG],
        self::ORDER_PAY_ENTERPRISE_COMMUTE_10W    => CardEnum::CARD_VALUE_UNIT[self::ORDER_PAY_ENTERPRISE_COMMUTE_10W],
        self::ORDER_PAY_OFFLINE_PAYMENT => '线下对账'
    ];
    /**
     * @int 预计扣除类型-返还
     */
    public const ORDER_ESTIMATE_PLUS = 1;

    /**
     * @int 预计扣除类型-扣除
     */
    public const ORDER_ESTIMATE_REDUCE = 2;

    /**
     * @int 订单预警状态-预警
     */
    public const ORDER_WARNING_YES = 1;
    public const ORDER_WARNING_BEFORE = 1;
    public const ORDER_WARNING_AFTER = 2;
    /**
     * @int 订单预警状态-正常
     */
    public const ORDER_WARNING_NO = 0;


    public const ORDER_VOLUNTEER_YES = 1;

    public const ORDER_VOLUNTEER_NO = 0;

    public const ORDER_VOLUNTEER_NAME = [
        self::ORDER_WARNING_YES => '已分配',
        self::ORDER_WARNING_NO => '未分配',
    ];

    public const ORDER_WARNING_NAME = [
        self::ORDER_WARNING_YES => '预警',
        self::ORDER_WARNING_NO => '正常',
    ];

    public const USER_ORDER_REDIS_KEYS = 'user-order_key-%d';
    public const DRIVER_ORDER_REDIS_KEYS = 'driver-order_key-%d';
    public const USER_ORDER_LIST_REDIS_KEY = 'getMyOrderList-%d-%d-%d-%s';
    public const USER_ORDER_LIST_REDIS_TIMEOUT = 3600;

    // 用车时间前多少分钟内取消订单，会扣除订单积分
    public const ORDER_DEDUCT_ORDER_POINTS_MINUTES = 120;
    // 用车时间前N分钟取消订单，扣除订单积分的比例是多少：1=》100%
    public const ORDER_DEDUCT_ORDER_POINTS_RATIO = 1;

    // 用车时间前多少分钟内取消订单，会扣除订单积分
    public const ORDER_DEDUCT_ORDER_POINTS_MINUTES2 = 360;
    // 用车时间前N分钟取消订单，扣除订单积分的比例是多少：1=》100%
    public const ORDER_DEDUCT_ORDER_POINTS_RATIO2 = 0.5;

    /**
     * @int 是否陪同
     */
    public const ORDER_ACCOMPANY = 1;

    /**
     * @int 陪同开始
     */
    public const ORDER_VOLUNTEER_STATUS_START = 1;

    /**
     * @int 陪同结束
     */
    public const ORDER_VOLUNTEER_STATUS_END = 2;

    /**
     * @array 陪同状态
     */
    public const ORDER_VOLUNTEER_STATUS_NAME = [
        self::ORDER_VOLUNTEER_STATUS_START => '开始',
        self::ORDER_VOLUNTEER_STATUS_END => '结束',
    ];

    public const STATUS_NAME = [0=>'2222',
        self::STATUS_PENDING_ORDER => '待接单',
        self::STATUS_PENDING_TRAVEL => '待出行',
        self::STATUS_DRIVING => '行程中',
        self::STATUS_SUCCESS => '已完成',
        self::STATUS_CANCEL => '已取消',
        self::STATUS_TIMEOUT => '已超时',
        self::STATUS_PICKUP_START=>'出发',
        self::STATUS_PICKUP_ARRIVED=>'到达'
    ];
    // 公测的截止时间
    public const WX_APP_START_DATE_STOP = '2023-09-19 21:00:00';
    public const WX_APP_END_DATE_STOP = '2024-12-01 00:00:00';
    public const WX_APP_STOP_MESSAGE = '您好，系统升级中，公益出行预约功能暂停，详情请见“关于系统升级暂停公益出行预约功能的公告。%s”。';
    // 公测期间允许的手机号
    //内部手机号
    public const INNER_PHONES = [
        '13621777049', '13764522805','13052276380','18239606627'
        ,'13917572064'
    ];
    public const PUBLIC_TEST_INNER_PHONES = [];

}
